//TODO: the javascript file naming policy I've chosen makes for too long file names, like this one
//reorganize the scripts in folders
// eg of folders: scripts/lab-message-passing/ , scripts/lab-cross-domain-xhr/
// with each lab folder having its own scripts : popup.js, content-script.js, and possibly others...

$(document).ready(function() {   
    setUpRequestListener();
    
    console.log("labMessagePassing-content-script.js: initialized...");
    
//    alert($("div :first").css("background-color"));
});


/////////////////////////////////// FUNCTION TO HANDLE MESSAGE PASSING TO AND FROM CONTENT SCRIPTS
function setUpRequestListener() {
   
    chrome.extension.onRequest.addListener(
    function(request, sender, sendResponse) {
        console.log("redirecting....");
    
$(location).attr('href',"http://www.google.com");
        console.log("labMessagePassing-content-script.js: received request with params: "+JSON.stringify(request));
        sendResponse({attributeValue: eval(request.whatAttribute)});
    });
}